//
//  SEExamineRecordFundusViewModel.swift
//  SmartEyeForPatient
//
//  Created by qdsg on 2021/4/26.
//

import UIKit

class SEExamineRecordFundusViewModel: SEExamineRecordBaseViewModel {

    override var numberOfSections: Int {
        return 1
    }

    override func numberOfRowInSection(section: Int) -> Int {
        return fundusCellModels.count
    }

    func fundusCellModel(index: Int) -> SEExamineRecordFundusCellModel {
        guard index < fundusCellModels.count else {
            return SEExamineRecordFundusCellModel()
        }
        return fundusCellModels[index]
    }

    var fundusCellModels: [SEExamineRecordFundusCellModel] {
        var array: [SEExamineRecordFundusCellModel] = []
        if !model.odImageUrl.isEmpty {
            array.append(SEExamineRecordFundusCellModel(titleText: "右眼",
                                                        imgUrlStr: model.odImageUrl))
        }
        if !model.osImageUrl.isEmpty {
            array.append(SEExamineRecordFundusCellModel(titleText: "左眼",
                                                         imgUrlStr: model.osImageUrl))
        }
        return array
    }

}
